<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <script src="../vue.js"></script>
</head>
<body>
  <div id="app">
    <button @click="openMessageBox">打开对话框</button>
  </div>
  <script type="module">
    import { MessageBox } from './MessageBox.js'
    new Vue({
      el: '#app',
      methods: {
        openMessageBox() {
          MessageBox.confirm('你真的要删除吗？')
          .then(() => {
            console.log('确认了')
          })
          .catch(() => {
            console.log('取消了')
          })
        }
      },
    })
  </script>
</body>
</html>